home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / graphics / 3dvect37.zip / MOVEIT.ASM < prev    next >
Assembly Source File  |  1994-06-22  |  22KB  |  904 lines

  1. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  2. ;
  3. ; Filename     : moveit.asm
  4. ; Included from: Main Assembley Module
  5. ; Description  : Animation sequencing routines
  6. ;
  7. ; Written by: John McCarthy
  8. ;             1316 Redwood Lane
  9. ;             Pickering, Ontario.
  10. ;             Canada, Earth, Milky Way (for those out-of-towners)
  11. ;             L1X 1C5
  12. ;
  13. ; Internet/Usenet:  BRIAN.MCCARTHY@CANREM.COM
  14. ;         Fidonet:  Brian McCarthy 1:229/15
  15. ;   RIME/Relaynet: ->CRS
  16. ;
  17. ; Home phone, (905) 831-1944, don't call at 2 am eh!
  18. ;
  19. ; John Mccarthy would really love to work for a company programming Robots
  20. ; or doing some high intensive CPU work.  Hint. Hint.
  21. ;
  22. ; Send me your protected mode source code!
  23. ; Send me your Objects!
  24. ; But most of all, Send me a postcard!!!!
  25. ;
  26. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  27.  
  28.         .386p
  29.  
  30. code32  segment para public use32
  31.         assume cs:code32, ds:code32
  32.  
  33.         include pmode.ext       ; protected mode externals by TRAN
  34.         include xmouse.ext      ; xmode mouse externals
  35.         include xmode.ext       ; xmode externals by matt pritchard
  36.         include irq.ext         ; irq timing externals
  37.         include 3d.ext
  38.         include stars.ext
  39.         include font.ext
  40.         include land.ext
  41.  
  42.         extrn objbase:dword     ; object lists and bitmap lists are
  43.         extrn bitbase:dword     ; external! set to 0 if none
  44.         extrn bitx:dword        ; x and y sizes for 3d conversion
  45.         extrn bity:dword
  46.  
  47.         include macros.inc
  48.         include equ.inc
  49.  
  50.         public animate_this
  51.         public _standard_screen_draw
  52.  
  53. framex  dd number_of_spaces dup (0) ; when to access next sequence (# from wait)
  54. framey  dd number_of_spaces dup (0) ; last access to sequence (# for wait)
  55. command dw number_of_spaces dup (0) ; current immediate command (wait type)
  56. comman2 dw number_of_spaces dup (0) ; immediate 2nd command (align type)
  57. speed   dw number_of_spaces dup (0) ; speed if align_d is used
  58. wheads  dd number_of_spaces dup (0) ; offsets to headers
  59. iheads  dw number_of_spaces dup (0) ; indexes in headers
  60. objnum  dw number_of_spaces dup (0) ; object number for header
  61. offseq  dd number_of_spaces dup (0) ; offset of current sequence for headers
  62.  
  63. hdnum   dw 0                 ; number of headers
  64. animo   dd 0                 ; animation base offset
  65. listas  dd 0                 ; offset to header list
  66. seqas   dd 0                 ; offset to sequence list
  67.  
  68. curhead dw 0                 ; current header being processed
  69. curobj  dw 0                 ; current object being processed
  70. countdn dw 0                 ; countdown for headers left to process
  71.  
  72. jumphere dd o _standard_screen_draw ; customized screen update routine
  73.  
  74. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  75. ; Animate_this: Perform animation sequencing
  76. ; In:
  77. ;   ESI -> Begining of animation data
  78. ;   EDX -> Plot routine (for drawing of main screen)
  79. ;      usually offset _standard_screen_draw
  80. ;      In:none   Out:z=1 exit
  81. ; Out:null
  82. ; Notes:
  83. ;  See the example file sequence.inc and see the macro file  moveit.inc  for
  84. ;  details.  The offset of EDX points to your customized screen plot routine
  85. ;  when Z is not equal, routine exits (eg je exit_animation).  EDX does  not
  86. ;  have to be set at the start if you dont want.  You can change  it  during
  87. ;  the animation by using the new_mainline command.
  88. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  89.  
  90. animate_this:
  91.         mov animo,esi        ; save original animation offset
  92.         mov jumphere,edx
  93.         mov edx,esi
  94.  
  95.         lodsw                ; get number of headers
  96.         mov hdnum,ax
  97.  
  98.         movzx ecx,ax         ; set counter for next
  99.  
  100.         xor eax,eax
  101.         lodsw                ; get offset to list
  102.         mov ebx,eax
  103.         lodsw                ; get offset to sequence list
  104.  
  105.         mov esi,edx
  106.         add eax,esi
  107.         add esi,ebx
  108.         mov listas,esi
  109.         mov seqas,eax
  110.  
  111.         xor ebp,ebp
  112.  
  113. load_head_loop:
  114.  
  115.         xor eax,eax          ; get header offset from "lists"
  116.         lodsw
  117.  
  118.         add eax,edx          ; add to animation start
  119.         mov wheads[ebp*4],eax
  120.  
  121.         mov framex[ebp*4],1  ; reset some stuff
  122.         mov framey[ebp*4],1
  123.         mov command[ebp*2],isetup_header ; 1 = setup_header command
  124.         mov comman2[ebp*2],iskip_header  ; 0 = skip header (alignment type)
  125.         mov iheads[ebp*2],0
  126.  
  127.         inc bp
  128.         loop load_head_loop
  129.  
  130. big_animation_loop:
  131.         mov ax,hdnum
  132.         mov countdn,ax
  133.         mov curhead,0
  134.  
  135. ; perform immediate commands - waits and alignments
  136.  
  137. im_loop:
  138.         movzx ebp,curhead
  139.  
  140.         mov ax,objnum[ebp*2]
  141.         mov curobj,ax
  142.  
  143.         movzx esi,command[ebp*2]
  144.         jmp immediate_commands[esi*4] ; call command in table
  145.  
  146. return_imm1:
  147.         movzx ebp,curhead
  148.         movzx esi,comman2[ebp*2]
  149.         jmp immediate_commands[esi*4]
  150.  
  151. skip_header:
  152.         inc curhead
  153.  
  154.         dec countdn
  155.         jnz im_loop
  156.  
  157.         call [jumphere]           ; user defined screen update routine
  158.  
  159.         jne big_animation_loop
  160.  
  161. wait_until_the_bimbo_releases_the_esc_key:
  162.         in al,60h                 ; test keyboard again
  163.         cmp al,1
  164.         je wait_until_the_bimbo_releases_the_esc_key
  165.  
  166.         ret
  167.  
  168. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  169. ; Thats it folks - the code above is all thats needed for an animation
  170. ; the stuff below are just commands for those macros in moveit.inc
  171. ;
  172. ; Immediate commands - done every frame (not called by sequencer, but flagged
  173. ; for calling by macros)
  174. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  175.  
  176. setup_header:
  177.         movzx ebp,curhead
  178.         movzx esi,iheads[ebp*2]
  179.         add esi,wheads[ebp*4]
  180.         xor eax,eax
  181.         lodsw                  ; get next header command
  182.  
  183.         jmp header_commands[eax*4]
  184.  
  185. align_d:
  186.         movzx ebp,curhead
  187.         movsx ebp,[speed+ebp*2]
  188.         movzx esi,curobj
  189.         mov edi,65535        ; infinite time factor
  190.         call set_speed
  191.         jmp skip_header
  192.  
  193. align_a:
  194.         movzx ebp,curhead
  195.         movzx edi,[speed+ebp*2]
  196.         movzx esi,curobj
  197.         call point_dir_time
  198.         jmp skip_header
  199.  
  200. wait_lc:
  201.         mov ax,w framex[ebp*4]
  202.         mov bp,curobj
  203.         cmp lcount[ebp*2],ax
  204.         jle do_more_seqs
  205.         jmp return_imm1
  206.  
  207. wait_ac:
  208.         mov ax,w framex[ebp*4]
  209.         mov bp,curobj
  210.         cmp acount[ebp*2],ax
  211.         jle do_more_seqs
  212.         jmp return_imm1
  213.  
  214. wait_fa:
  215.         mov eax,frame_number
  216.         cmp framex[ebp*4],eax
  217.         jle do_more_seqs
  218.         jmp return_imm1
  219.  
  220. wait_fr:
  221.         mov eax,framex[ebp*4]
  222.         add eax,framey[ebp*4]
  223.         cmp eax,frame_number
  224.         jle do_more_seqs
  225.         jmp return_imm1
  226.  
  227. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  228. ; header commands
  229. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  230.  
  231. done:
  232.         mov command[ebp*2],iskip_header ; set immediate command to skip_header
  233.         mov comman2[ebp*2],iskip_header
  234.         stc
  235.         jmp skip_header
  236.  
  237. done_all:                      ; exit entire animation
  238.         ret
  239.  
  240. loopto:                       ; set new location for header index
  241.         lodsw
  242.         mov iheads[ebp*2],ax
  243.         jmp setup_header
  244.  
  245. seqit:                        ; perform sequence number x until wait or exit
  246.         movzx ebp,curhead
  247.         xor eax,eax
  248.         lodsw
  249.         mov edi,seqas
  250.         mov ax,[edi+eax*2]
  251.         mov esi,animo
  252.         add esi,eax
  253.         add iheads[ebp*2],4
  254.         mov offseq[ebp*4],esi
  255. do_more_seqs:
  256.         movzx ebp,curhead
  257.         mov esi,offseq[ebp*4]
  258. seq_lp:
  259.         movzx ebp,curhead
  260.         xor eax,eax
  261.         mov offseq[ebp*4],esi
  262.         lodsw
  263.         clc
  264.         call sequence_commands[eax*4]
  265.         jnc seq_lp
  266.  
  267.         jmp setup_header
  268.  
  269. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  270. ; Sequencing commands
  271. ; In:
  272. ;  ESI -> macro data from animation
  273. ;  EBP -  current header being processed
  274. ;   CF=0
  275. ; Out:
  276. ;  ESI -> next sequence command load location
  277. ;   CF=1 - done sequence
  278. ;   CF=0 - more commands to perform
  279. ; Notes: Look in the moveit.inc file to find out how these are used
  280. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  281.  
  282. xoff:
  283.         lodsw
  284.         movzx edi,curobj
  285.         xor ax,0ffffh
  286.         and onoff[edi],al
  287.         clc
  288.         ret
  289. xon:
  290.         lodsw
  291.         movzx edi,curobj
  292.         or onoff[edi],al
  293.         clc
  294.         ret
  295.  
  296. xnew_object:
  297.         push esi
  298.         call search_next_available_object
  299.         call init_object
  300.         movzx ebp,curhead
  301.         mov objnum[ebp*2],si
  302.         mov curobj,si
  303.         pop esi
  304.         clc
  305.         ret
  306.  
  307. xcamera:
  308.         movzx ebp,curhead
  309.         mov ax,cameraobject
  310.         mov objnum[ebp*2],ax
  311.         mov curobj,ax
  312.         clc
  313.         ret
  314.  
  315. xreset_irq:
  316.         call reset_raster_count
  317.         clc
  318.         ret
  319.  
  320. xset_mode:
  321.         push esi
  322.         lodsw
  323.         push ax
  324.         lodsw
  325.         push ax
  326.         lodsw
  327.         push ax
  328.         lodsw
  329.         push ax
  330.         call set_vga_modex
  331.         pop esi
  332.         add esi,8
  333.         cmp ax,-1               ; test for error in setting videomode
  334.         je zgetoutq
  335.         pop eax
  336. zgetoutq:
  337.         clc
  338.         ret
  339.  
  340. xset_clip_a:
  341. xset_clip_o:
  342.  
  343. xshape:
  344.         lodsw
  345.         push esi
  346.         movzx esi,curobj
  347.         call set_shape
  348.         pop esi
  349.         clc
  350.         ret
  351.  
  352. xmove:
  353.         lodsd
  354.         mov ebx,eax
  355.         lodsd
  356.         mov ecx,eax
  357.         lodsd
  358.         mov ebp,eax
  359.         lodsw
  360.         mov di,ax
  361.         push esi
  362.         movzx esi,curobj
  363.         call move_si
  364.         pop esi
  365.         clc
  366.         ret
  367.  
  368. xpoint_tm:
  369.         lodsw
  370.         movzx edi,ax
  371.         push esi
  372.         movzx esi,curobj
  373.         call point_dir_time
  374.         pop esi
  375.         clc
  376.         ret
  377.  
  378. xlocation:
  379.         lodsd
  380.         mov ebx,eax
  381.         lodsd
  382.         mov ecx,eax
  383.         lodsd
  384.         mov ebp,eax
  385.         push esi
  386.         movzx esi,curobj
  387.         call put_object
  388.         pop esi
  389.         clc
  390.         ret
  391.  
  392. xlocationx:
  393.         lodsd
  394.         movzx edi,curobj
  395.         mov xs[edi*4],eax
  396.         clc
  397.         ret
  398.  
  399. xlocationy:
  400.         lodsd
  401.         movzx edi,curobj
  402.         mov ys[edi*4],eax
  403.         clc
  404.         ret
  405.  
  406. xlocationz:
  407.         lodsd
  408.         movzx edi,curobj
  409.         mov zs[edi*4],eax
  410.         clc
  411.         ret
  412.  
  413. xangle:
  414.         lodsw
  415.         mov bx,ax
  416.         lodsw
  417.         mov cx,ax
  418.         lodsw
  419.         mov bp,ax
  420.         push esi
  421.         movzx esi,curobj
  422.         call set_angle
  423.         pop esi
  424.         clc
  425.         ret
  426.  
  427. xanglex:
  428.         lodsw
  429.         movzx edi,curobj
  430.         mov vxs[edi*2],ax
  431.         clc
  432.         ret
  433. xangley:
  434.         lodsw
  435.         movzx edi,curobj
  436.         mov vys[edi*2],ax
  437.         clc
  438.         ret
  439. xanglez:
  440.         lodsw
  441.         movzx edi,curobj
  442.         mov vzs[edi*2],ax
  443.         clc
  444.         ret
  445.  
  446. xwait_for:
  447.         mov eax,frame_number
  448.         mov framey[ebp*4],eax
  449.         xor eax,eax
  450.         lodsw
  451.         mov command[ebp*2],ax
  452.         mov ebx,eax
  453.         lodsd
  454.         mov framex[ebp*4],eax
  455.         mov offseq[ebp*4],esi
  456.         pop ecx                ; remove seq_it return address
  457.         jmp immediate_commands[ebx*4]
  458.  
  459. xexit:
  460.         stc
  461.         ret
  462.  
  463. xbitmap:
  464. xbullet:
  465. xalign_a:
  466.         lodsw
  467.         push esi
  468.         movzx ebp,curhead
  469.         mov speed[ebp*2],ax
  470.         mov comman2[ebp*2],ialign_a ; see immediate header command list below
  471.         movzx edi,ax
  472.         movzx esi,curobj
  473.         call point_dir_time
  474.         pop esi
  475.         clc
  476.         ret
  477.  
  478. xalign_d:
  479.         lodsw
  480.         push esi
  481.         movzx ebp,curhead
  482.         mov speed[ebp*2],ax
  483.         mov comman2[ebp*2],ialign_d ; see immediate header command list below
  484.         movsx ebp,ax
  485.         movzx esi,curobj
  486.         mov edi,65535
  487.         call set_speed
  488.         pop esi
  489.         clc
  490.         ret
  491.  
  492. xalign_off:
  493.         movzx ebp,curhead
  494.         mov comman2[ebp*2],7
  495.         clc
  496.         ret
  497.  
  498. xfade_all:
  499.         lodsw
  500.         shl eax,8
  501.         lodsb
  502.         lodsb
  503.         shl eax,8
  504.         lodsb
  505.         lodsb
  506.         push eax
  507.         lodsw
  508.         mov bh,al
  509.         lodsw
  510.         mov bl,al
  511.         pop eax
  512.         pushad
  513.         call _fade_all
  514.         popad
  515. zfade_cont:
  516.         lodsw
  517.         or  ax,ax          ; 0 = wait for fade to complete, >0 = let irq do fade
  518.         jne zwait_fade
  519.         call _wait_for_fade
  520. zwait_fade:
  521.         clc
  522.         ret
  523.  
  524. xfade_to:
  525.         lodsd
  526.         mov ebp,eax
  527.         add ebp,animo      ; make offset of palette relative!
  528.         lodsw
  529.         mov bh,al
  530.         lodsw
  531.         mov bl,al
  532.         push esi
  533.         mov esi,ebp
  534.         call _fade_palette_read
  535.         pop esi
  536.         jmp zfade_cont
  537.  
  538. xdraw_icon:
  539. xinitialize:
  540.         push esi
  541.         call wipeoffpalette
  542.         call initpages
  543.         mov ebp,o fontlength
  544.         mov esi,o font0
  545.         mov edi,o font1
  546.         call initfont
  547.         call init_tables
  548.         call reset_raster_count
  549.         pop esi
  550.         clc
  551.         ret
  552.  
  553. xfollow_me:
  554.         lodsw
  555.         push esi
  556.         movzx esi,curobj
  557.         movzx edi,ax
  558.         call newfollow
  559.         pop esi
  560.         clc
  561.         ret
  562.  
  563. xfollow_obj:
  564.         lodsw
  565.         mov bp,ax
  566.         lodsw
  567.         push esi
  568.         movzx esi,bp
  569.         movzx edi,ax
  570.         call newfollow
  571.         pop esi
  572.         clc
  573.         ret
  574.  
  575. xpoint_obj:
  576.         lodsd
  577.         mov ebx,eax
  578.         lodsd
  579.         mov ecx,eax
  580.         lodsd
  581.         mov ebp,eax
  582.         lodsw
  583.         movzx edi,ax
  584.         push esi
  585.         movzx esi,curobj
  586.         call point_time
  587.         pop esi
  588.         clc
  589.         ret
  590.  
  591. xtext:
  592.         lodsd
  593.         push esi
  594.         mov esi,eax
  595.         call tstring
  596.         pop esi
  597.         clc
  598.         ret
  599.  
  600. xinit_bitmap:
  601.         lodsw
  602.         movzx edi,ax
  603.         lodsd
  604.         mov bitbase[edi*4],eax
  605.         xor eax,eax
  606.         lodsw
  607.         mov bitx[edi*4],eax
  608.         lodsw
  609.         mov bity[edi*4],eax
  610.         clc
  611.         ret
  612.  
  613. xinit_shape:
  614.         lodsw
  615.         movzx edi,ax
  616.         lodsd
  617.         add eax,animo       ; shape data is relative to animation offset
  618.         mov objbase[edi*4],eax
  619.         push esi
  620.         call pre_cal_lambert
  621.         pop esi
  622.         clc
  623.         ret
  624.  
  625. xno_rotation:
  626.         push esi
  627.         movzx esi,curobj
  628.         call use_no_rotations
  629.         pop esi
  630.         clc
  631.         ret
  632.  
  633. xfull_rotation:
  634.         push esi
  635.         movzx esi,curobj
  636.         call use_full_rotations
  637.         pop esi
  638.         clc
  639.         ret
  640.  
  641. xxref_palette:
  642.         lodsd
  643.         push esi
  644.         movzx esi,curobj
  645.         mov ebx,eax
  646.         call set_xref_palette
  647.         pop esi
  648.         clc
  649.         ret
  650.  
  651. xtwist_it:
  652.         lodsd
  653.         mov ebx,eax
  654.         lodsd
  655.         mov ecx,eax
  656.         lodsd
  657.         mov ebp,eax
  658.         lodsw
  659.         mov di,ax
  660.         push esi
  661.         movzx esi,curobj
  662.         call twist_si
  663.         pop esi
  664.         clc
  665.         ret
  666.  
  667. xtwist_x:
  668.         lodsd
  669.         mov ebx,eax
  670.         lodsw
  671.         mov di,ax
  672.         push esi
  673.         movzx esi,curobj
  674.         call twist_xonly
  675.         pop esi
  676.         clc
  677.         ret
  678.  
  679. xtwist_y:
  680.         lodsd
  681.         mov ecx,eax
  682.         lodsw
  683.         mov di,ax
  684.         push esi
  685.         movzx esi,curobj
  686.         call twist_yonly
  687.         pop esi
  688.         clc
  689.         ret
  690.  
  691. xtwist_z:
  692.         lodsd
  693.         mov ebp,eax
  694.         lodsw
  695.         movzx edi,ax
  696.         push esi
  697.         movzx esi,curobj
  698.         call twist_zonly
  699.         pop esi
  700.         clc
  701.         ret
  702.  
  703. xrotate_it:
  704.         movzx edi,curobj
  705.         lodsw
  706.         mov vxadds[edi*2],ax
  707.         lodsw
  708.         mov vyadds[edi*2],ax
  709.         lodsw
  710.         mov vzadds[edi*2],ax
  711.         lodsw
  712.         mov acount[edi*2],ax
  713.         clc
  714.         ret
  715.  
  716. xrotate_x:
  717.         movzx edi,curobj
  718.         lodsw
  719.         mov vxadds[edi*2],ax
  720.         lodsw
  721.         mov acount[edi*2],ax
  722.         clc
  723.         ret
  724.  
  725. xrotate_y:
  726.         movzx edi,curobj
  727.         lodsw
  728.         mov vyadds[edi*2],ax
  729.         lodsw
  730.         mov acount[edi*2],ax
  731.         clc
  732.         ret
  733.  
  734. xrotate_z:
  735.         movzx edi,curobj
  736.         lodsw
  737.         mov vzadds[edi*2],ax
  738.         lodsw
  739.         mov acount[edi*2],ax
  740.         clc
  741.         ret
  742.  
  743. xcall_me:
  744.         lodsd
  745.         push esi
  746.         call [eax]
  747.         pop esi
  748.         ret
  749.  
  750. xnew_mainline:
  751.         lodsd
  752.         mov jumphere,eax
  753.         ret
  754.  
  755. xoption1:
  756.         clc
  757.         ret
  758. xoption2:
  759.         clc
  760.         ret
  761. xoption3:
  762.         clc
  763.         ret
  764.  
  765. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  766. ; Immediate commands - done before header commands
  767. ; "o" = "offset"
  768. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  769.  
  770. imm_num dw (o header_commands - o immediate_commands)/4 ; number of imm comnds
  771.  
  772. ireturn_imm1  equ 0
  773. isetup_header equ 1
  774. ialign_d      equ 2
  775. iwait_lc      equ 3
  776. iwait_ac      equ 4
  777. iwait_fa      equ 5
  778. iwait_fr      equ 6
  779. iskip_header  equ 7
  780. ialign_a      equ 8
  781.  
  782. immediate_commands label dword
  783.    dd o return_imm1  ; 0
  784.    dd o setup_header ; 1
  785.    dd o align_d      ; 2   ; continously move it in direction it is pointing
  786.    dd o wait_lc      ; 3
  787.    dd o wait_ac      ; 4
  788.    dd o wait_fa      ; 5
  789.    dd o wait_fr      ; 6
  790.    dd o skip_header  ; 7
  791.    dd o align_a      ; 8   ; continously point it in direction it is moving
  792.  
  793. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  794. ; Header commands - sequencing redirection and looping
  795. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  796.  
  797. header_commands label dword
  798.    dd o done         ; 0
  799.    dd o done_all     ; 1
  800.    dd o loopto       ; 2
  801.    dd o seqit        ; 3
  802.  
  803. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  804. ; Animation commands:
  805. ; * = not yet implemented
  806. ; 0 = free space for more commands
  807. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  808.  
  809. sequence_commands label dword
  810.    dd o xoff          ; 0
  811.    dd o xon           ; 1
  812.    dd o xnew_object   ; 2
  813.    dd o xcamera       ; 3
  814.    dd 0               ; 4
  815.    dd o xreset_irq    ; 5
  816.    dd o xset_mode     ; 6
  817.    dd o xset_clip_a   ; 7  *
  818.    dd o xset_clip_o   ; 8  *
  819.    dd 0               ; 9
  820.    dd o xshape        ; 10
  821.    dd o xmove         ; 11
  822.    dd o xpoint_tm     ; 12
  823.    dd 0               ; 13
  824.    dd o xlocation     ; 14
  825.    dd o xlocationx    ; 15
  826.    dd o xlocationy    ; 16
  827.    dd o xlocationz    ; 17
  828.    dd o xangle        ; 18
  829.    dd o xanglex       ; 19
  830.    dd o xangley       ; 20
  831.    dd o xanglez       ; 21
  832.    dd o xwait_for     ; 22
  833.    dd o xexit         ; 23
  834.    dd o xbitmap       ; 24 *
  835.    dd o xbullet       ; 25 *
  836.    dd o xalign_a      ; 26
  837.    dd o xalign_d      ; 27
  838.    dd o xalign_off    ; 28
  839.    dd 0               ; 29
  840.    dd o xfade_all     ; 30
  841.    dd o xfade_to      ; 31
  842.    dd o xdraw_icon    ; 32 *
  843.    dd o xinitialize   ; 33
  844.    dd o xfollow_me    ; 34
  845.    dd o xfollow_obj   ; 35
  846.    dd o xpoint_obj    ; 36
  847.    dd o xtext         ; 37
  848.    dd o xinit_bitmap  ; 38
  849.    dd o xinit_shape   ; 39
  850.    dd o xno_rotation  ; 40
  851.    dd o xfull_rotation; 41
  852.    dd o xxref_palette ; 42
  853.    dd o xtwist_it     ; 43
  854.    dd o xtwist_x      ; 44
  855.    dd o xtwist_y      ; 45
  856.    dd o xtwist_z      ; 46
  857.    dd o xrotate_it    ; 50
  858.    dd o xrotate_x     ; 48
  859.    dd o xrotate_y     ; 49
  860.    dd o xrotate_z     ; 50
  861.    dd o xcall_me      ; 51
  862.    dd o xnew_mainline ; 52
  863.    dd 0               ; 53
  864.    dd 0               ; 54
  865.    dd 0               ; 55
  866.    dd 0               ; 56
  867.    dd 0               ; 57
  868.    dd 0               ; 58
  869.    dd 0               ; 59
  870.    dd o xoption1      ; 60
  871.    dd o xoption2      ; 61
  872.    dd o xoption3      ; 62
  873.  
  874. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  875. ; Standard_screen_draw:
  876. ;  Default screen redraw code.  Use this for EDX in before calling animate_this
  877. ; In : none
  878. ; Out:
  879. ;       Z=1 exit
  880. ;       Z=0 continue
  881. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  882.  
  883. _standard_screen_draw:
  884.  
  885.         call look_at_it           ; make camera look at selected object
  886.         call setsincose           ; set rotation multipliers for eye
  887.        ;call draw_landscape       ; draw background landscape
  888.         call clear_fill           ; clear video memory (last screen)
  889.         call show_stars           ; plot background stars
  890.         call makeobjs             ; plot all objects in sides table
  891.        ;mov eax,frame_number
  892.        ;mov number_eax,eax
  893.        ;call put_at_top           ; timing tool!
  894.         call flip_page            ; flip video pages
  895.         call updvectors           ; move objects around, rotate them
  896.  
  897.         in al,60h                 ; test keyboard
  898.         cmp al,1                  ; je = exit
  899.  
  900.         ret
  901.  
  902. code32  ends
  903.         end
  904.